package com.why.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.why.entity.Roles;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author why
 * @since 2022-02-22
 */
public interface RolesMapper extends BaseMapper<Roles> {


    @Select("select r.* from users u inner join user_role_relation urr on urr.user_id = u.id inner join roles r on r.id = urr.role_id where u.username =#{userName}")
    List<Roles> findRoleByUsername(String userName);
}
